package com.oto.message;

import java.util.ArrayList;
import java.util.List;

import com.oto.api.Message;
import com.oto.bean.Account;
import com.oto.bean.Pack;

/**
 * @author xueqiang.mi
 * @since 2011-1-9
 */
public class ShareMessage extends AbstractMessage {
	private static final long serialVersionUID = 3096120904562124145L;
	
	// 分享数据的所有者
	private Account owner;
	// 该数据同时分发给哪些用户，这个不允许用户手工填写，只能从其好友列表中获得
	private List<Account> users;

	public ShareMessage() {
		setType(Message.TYPE_SHARE);
	}

	public Account getOwner() {
		return owner;
	}

	public Pack getPack() {
		return (Pack) super.getData();
	}

	public List<Account> getUsers() {
		if (users == null) {
			users = new ArrayList<Account>();
		}
		return users;
	}

	public void setOwner(Account owner) {
		this.owner = owner;
	}

	public void setPack(Pack pack) {
		this.data = pack;
	}

	public void setUsers(List<Account> users) {
		this.users = users;
	}

	@Override
	public String toString() {
		return "ShareMessage [owner=" + owner + "]";
	}
}
